import Cookies from 'js-cookie'

const TokenKey = 'vue_admin_itcast.cnxxx'

// 储存时间戳的键名
const TokenTimeStamp = 'time_stamp_token'

// 获取
export function getTokenTimeStamp() {
  return Cookies.get(TokenTimeStamp)
}

// 储存token到cook中
export function setTokenTimeStamp(time) {
  return Cookies.set(TokenTimeStamp, time)
}

// 获取cookie中的token
export function getToken() {
  return Cookies.get(TokenKey)
}

export function setToken(token) {
  return Cookies.set(TokenKey, token)
}

export function removeToken() {
  return Cookies.remove(TokenKey)
}
